package com.hongshu.web.controller.recommendation;

import com.hongshu.common.core.enums.Result;
import com.hongshu.common.core.validator.myVaildator.noLogin.NoLoginIntercept;
import com.hongshu.web.service.recommendation.ModernRecommendationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 现代化推荐控制器
 * 提供多种推荐策略的API接口
 *
 * @author hongshu
 * @date 2024/01/01
 */
@RestController
@RequestMapping("/api/recommendation")
@Slf4j
public class ModernRecommendController {

    @Autowired
    private ModernRecommendationService modernRecommendationService;


    /**
     * 推荐策略切换接口
     * 支持动态切换推荐策略
     */
    @NoLoginIntercept
    @GetMapping("/strategy/{currentPage}/{pageSize}")
    public Result<?> getRecommendationsByStrategy(@PathVariable long currentPage, @PathVariable long pageSize) {
        log.info("获取推荐: currentPage={}, pageSize={}", currentPage, pageSize);
        return Result.ok(modernRecommendationService.getRecommendNotes(currentPage, pageSize));
    }
}













